<template>
  <ex_super_dialog_form ref="auditDialog" v-bind="option" v-on="$listeners" @afterSubmitSuccess="afterSubmitSuccess">
  </ex_super_dialog_form>
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
      examine:false,
      remarkKey: 'remark',
      option: {
        customClass: "dialog_auto",
        submitDataHandle: (data) => {
          return { id: data.id, [this.remarkKey]: data.text || "" };
        },
        form: {
          itemClass: "form_item_default",
          inputClass: "form_input_default",
          model: [
            {
              key: "code",
              label: "label_purchase_order_code",
              formType: 'text'
            },
            {
              key: "text",
              label: "label_reject_reason",
              if:()=>!this.examine
            },
          ],
          rules: {
            'text': [{ required: true, message: this.$tt('tip_can_no_empty'), trigger: 'blur' }]
          },
        }
      }
    };
  },
  methods: {
    show({ data, title, url, remarkKey = 'remark',examine }) {
      this.examine = examine
      this.remarkKey = remarkKey
      this["$refs"]["auditDialog"].showNew({
        title: title,
        submitUrl: url,
        data: data
      });
    },
    close() {
      this.$refs.form.resetFields();
      this.$emit("close");
    },
    afterSubmitSuccess() {
      this.$emit("submit");
    },
  },
  destroyed() { },
};
</script>


